package com.sync.syncmasterdata.product.repository.oa;

import com.sync.syncmasterdata.product.entity.oa.ProductWorkflowDeleteEntity;
import com.sync.syncmasterdata.product.entity.oa.ProductWorkflowReStoreEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface InventoryForReStoreWorkflowRepository extends JpaRepository<ProductWorkflowReStoreEntity,String> {

    /**
     * 产品 复用时清单
     */
    @Query(nativeQuery = true,value="select dt4.id,TO_CHAR(main.REQUESTID) as requestid,dt4.inventory_code,dt4.product_name,dt4.bpmid,dt4.crmid,dt4.next_downtime from formtable_main_322 main inner join formtable_main_322_dt4 dt4 on dt4.mainid=main.id  where main.REQUESTID=:requestid")
    List<ProductWorkflowReStoreEntity> getProductWorkflowEntityForReStore(@Param(value = "requestid") String requestid);

}
